var deviceHelper = require("./device.js");
function getPhoneNumber(v) {
  const phoneNumberMap = {
    "08f39272005fbbf9": "18762750392",
    "1d2a32368fe6239d": "13065826251",
    "271b4a9052a3501c": "17704040918",
    "15e2ab0630873018": "13056768975",
    "d17a392b04a92a80": "15626591667",
    "e864bcdddfb104cf": "15212331291",
    "fd826f6ec3acf40c": "15212331276",
    "4959d47c74e79f00": "15212331201",
    "886b260a566ebda2": "17764297074",
    "8f8acfc5b649c33f": "15523623349",
    "fccc893185006249": "13193037083",
    "f276d54a1a6861d2": "19858302953",
    "1c73bd770f1da671": "18042059337",
    "6f042bfd09ad08e1": "14751017521",
  };
  return phoneNumberMap[v] || v;
}
module.exports = {
  post(data) {
    var url = "http://47.120.74.135" + "/api/log/add";
    return http.postJson(url, data);
  },
  log(msg, type, curApp) {
    console.log.apply(console, [msg]);
    type = type || 1;
    curApp = curApp || "";
    return this.post({
      curApp,
      battery: deviceHelper.getBattery(),
      type: String(type),
      msg: msg,
      phoneNumber: getPhoneNumber(deviceHelper.getAndroidId()),
      createTime: new Date().toISOString(),
    });
  },
};
